<template>
  <el-row>
    <!--      借款订单信息-->
    <el-card v-if="Object.keys(orderInfoData).length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ path === '/usr/auth' ? $t('authModule.orderDetail.title') : $t('collectDetail.auditOrder') }}
          </template>
          <table>
            <tr>
              <td>{{ $t('authModule.orderDetail.orderNo') }}</td>
              <td>{{ orderInfoData['orderNo'] }}</td>
              <td>{{ $t('authModule.orderDetail.createTime') }}</td>
              <td>{{ orderInfoData['createTimeStr'] }}</td>
              <td />
              <td />
            </tr>
            <tr>
              <td>{{ $t('authModule.orderDetail.userGrade') }}</td>
              <td>{{ orderInfoData['userGrade'] }}</td>
              <td>{{ $t('authModule.orderDetail.productType') }}</td>
              <td>{{ $t('authModule.orderDetail.orderType')[orderInfoData['loanProductType']] }}</td>
              <td>{{ $t('authModule.orderDetail.lendRate') }}</td>
              <td>{{ orderInfoData['lendRate'] ? (orderInfoData['lendRate']*100).toFixed(2) + '%' : '' }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.orderDetail.auditMoney') }}</td>
              <td>{{ orderInfoData['applyMoney'] }}</td>
              <td>{{ $t('authModule.orderDetail.loanDays') }}</td>
              <td>{{ (orderInfoData['loanDays'] && orderInfoData['applyMonth']) ? (orderInfoData['loanDays']*orderInfoData['applyMonth']) : '' }}</td>
              <td>{{ $t('authModule.orderDetail.orderPeriods') }}</td>
              <td>{{ orderInfoData['applyMonth'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.orderDetail.technologyRate') }}</td>
              <td>{{ orderInfoData['monthTechnologyCharge'] }}</td>
              <td>{{ $t('authModule.orderDetail.auditRate') }}</td>
              <td>{{ orderInfoData['monthAuditCharge'] }}</td>
              <td>{{ $t('authModule.orderDetail.currentRepay') }}</td>
              <td>{{ orderInfoData['currentRepay'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.orderDetail.packageName') }}</td>
              <td>{{ orderInfoData['packageName'] }}</td>
              <td>{{ $t('authModule.orderDetail.productName') }}</td>
              <td>{{ orderInfoData['appName'] }}</td>
              <td>{{ $t('authModule.orderDetail.versionNumber') }}</td>
              <td>{{ orderInfoData['systemVersion'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.orderDetail.latitudeLongitude') }}</td>
              <td>
                <div v-if="deviceInfoData && (deviceInfoData['longitude'] || deviceInfoData['latitude'])">
                  {{ deviceInfoData['longitude'] }}, {{ deviceInfoData['latitude'] }}
                </div>
              </td>
              <td />
              <td />
              <td />
              <td />
            </tr>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--      已绑定用户信息-->
    <el-card v-if="Object.keys(userInfoData).length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.userInfo.title') }}
          </template>
          <table>
            <tr>
              <td :style="{ 'backgroundColor': userInfoData['channelStr']!=null ? '#bbff00' : null }">{{ $t('authModule.userInfo.phone') }}</td>
              <td :style="{ 'backgroundColor': userInfoData['channelStr']!=null ? '#bbff00' : null }">{{ userInfoData['phoneNumber'] }}
                <span v-if="userInfoData['authPayment']" style="background-color: #ffbb00;color: #ffffff;padding: 5px">
                  {{ $t('authModule.userInfo.verified') }}
                </span>
              </td>
              <td>{{ $t('authModule.userInfo.name') }}</td>
              <td>{{ userInfoData['usernameShort'] }}</td>
              <td>{{ $t('authModule.userInfo.identity') }}</td>
              <td>{{ userInfoData['idNumber'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.userInfo.source') }}</td>
              <td>{{ userInfoData['channelStr'] }}</td>
              <td>{{ $t('authModule.userInfo.method') }}</td>
              <td>{{ userInfoData['promotionTypeStr'] }}</td>
              <td>{{ $t('authModule.userInfo.referrer') }}</td>
              <td>{{ userInfoData['referrerName'] }}</td>
            </tr>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--      设备信息-->
    <el-card v-if="Object.keys(deviceInfoData).length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.deviceInfo.title') }}
          </template>
          <table>
            <tr>
              <td>{{ $t('authModule.deviceInfo.time') }}</td>
              <td>{{ deviceInfoData['createTime'] }}</td>
              <td>{{ $t('authModule.deviceInfo.packageName') }}</td>
              <td>{{ deviceInfoData['packageName'] }}</td>
              <td>{{ $t('authModule.deviceInfo.productName') }}</td>
              <td>{{ deviceInfoData['appName'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.deviceInfo.versionNumber') }}</td>
              <td>{{ deviceInfoData['appVersion'] }}</td>
              <td>{{ $t('authModule.deviceInfo.ip') }}</td>
              <td>{{ deviceInfoData['ipAddress'] }}</td>
              <td>{{ $t('authModule.deviceInfo.deviceName') }}</td>
              <td>{{ deviceInfoData['deviceType'] }}</td>
            </tr>
            <tr>
              <td colspan="6">{{ $t('authModule.deviceInfo.info') }}</td>
            </tr>
            <tr>
              <td>IMEI</td>
              <td>{{ deviceInfoData['imei'] }}</td>
              <td>Android ID</td>
              <td>{{ deviceInfoData['androidId'] }}</td>
              <td />
              <td />
            </tr>
            <tr>
              <td>Google Ads ID</td>
              <td>{{ deviceInfoData['advertisingId'] }}</td>
              <td>RAM</td>
              <td>{{ deviceInfoData['ram'] }}</td>
              <td>ROM</td>
              <td>{{ deviceInfoData['rom'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.deviceInfo.resolution') }}</td>
              <td>{{ deviceInfoData['resolution'] }}</td>
              <td>{{ $t('authModule.deviceInfo.virtualMachine') }}</td>
              <td>{{ deviceInfoData['virtual'] }}</td>
              <td />
              <td />
            </tr>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--      个人信息-用户录入-->
    <el-card v-if="Object.keys(userInfoData).length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.personalInfo.title') }}
          </template>
          <table>
            <tr>
              <td>{{ $t('authModule.personalInfo.motherName') }}</td>
              <td>{{ userInfoData['motherName'] }}</td>
              <td>{{ $t('authModule.personalInfo.educationLevel') }}</td>
              <td>{{ $t('authModule.personalInfo.educationLevelType')[userInfoData['educationBackground']] }}</td>
              <td colspan="2">{{ $t('authModule.personalInfo.ktp') }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.personalInfo.gender') }}</td>
              <td>{{ $t('authModule.personalInfo.genderType1')[userInfoData['gender']] }}</td>
              <td>{{ $t('authModule.personalInfo.age') }}</td>
              <td>{{ userInfoData['age'] }}</td>
              <td colspan="2" rowspan="5">
                <div v-if="userInfoData['ktpPath']" style="height: 150px">
                  <el-image
                    style="width: 150px; height: 150px"
                    :src="userInfoData['ktpPath']"
                    :preview-src-list="[userInfoData['ktpPath']]"
                  />
                </div>
              </td>
            </tr>
            <tr>
              <td>{{ $t('authModule.personalInfo.maritalStatus') }}</td>
              <td>{{ $t('authModule.personalInfo.marital')[userInfoData['maritalStatus']] }}</td>
              <td>{{ $t('authModule.personalInfo.childStatus') }}</td>
              <td>{{ userInfoData['childNumber'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.personalInfo.livingType') }}</td>
              <td>{{ $t('authModule.personalInfo.livingTypeData')[userInfoData['residentialType']] }}</td>
              <td>{{ $t('authModule.personalInfo.livingTime') }}</td>
              <td>{{ $t('authModule.personalInfo.residentialDurationType')[userInfoData['residentialDuration']] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.personalInfo.address') }}</td>
              <td colspan="3">
                {{ userInfoData['province'] }}-{{ userInfoData['city'] }}-{{ userInfoData['regent'] }}-{{ userInfoData['block'] }}-{{ userInfoData['street'] }}
              </td>
            </tr>
            <tr>
              <td>{{ $t('authModule.personalInfo.account') }}</td>
              <td>{{ userInfoData['whatsapp'] }}</td>
              <td>{{ $t('authModule.personalInfo.email') }}</td>
              <td>{{ userInfoData['email'] }}</td>
            </tr>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--      工作信息-用户录入-->
    <el-card v-if="Object.keys(userWorkInfoData).length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.workInfo.title') }}
          </template>
          <table>
            <tr>
              <td>{{ $t('authModule.workInfo.socialIdentity') }}</td>
              <td>{{ $t('authModule.jobs')[userWorkInfoData['socialIdentityCode']] }}</td>
              <td>{{ $t('authModule.workInfo.income') }}</td>
              <td>{{ $t('authModule.income')[userWorkInfoData['monthlyIncome']] }}</td>
              <td colspan="2">{{ $t('authModule.workInfo.workIncome') }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.workInfo.company') }}</td>
              <td>{{ userWorkInfoData['companyName'] }}</td>
              <td>{{ $t('authModule.workInfo.phone') }}</td>
              <td>{{ userWorkInfoData['telphone'] }}</td>
              <td colspan="2" rowspan="2">
                <div style="height: 150px">
                  <el-image
                    v-if="userWorkInfoData['incomeProof']"
                    style="width: 150px; height: 150px"
                    :src="userWorkInfoData['incomeProof']"
                    :preview-src-list="[userWorkInfoData['incomeProof']]"
                  />
                </div>
              </td>
            </tr>
            <tr>
              <td>{{ $t('authModule.workInfo.address') }}</td>
              <td colspan="3">
                {{ userWorkInfoData['province'] }} - {{ userWorkInfoData['city'] }} - {{ userWorkInfoData['regent'] }} - {{ userWorkInfoData['block'] }} - {{ userWorkInfoData['street'] }}
              </td>
            </tr>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--      联系人-用户录入-->
    <el-card v-if="userContactData.length > 0" id="contactPerson">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.contactPerson.title') }}
          </template>
          <el-table
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            :data="userContactData"
            border
            :stripe="true"
            style="width: 100%;margin-top: 10px"
          >
            <el-table-column
              type="index"
              :label="$t('authModule.contactPerson.emergency')"
              width="120"
            />
            <el-table-column
              prop="contactPhone"
              :label="$t('authModule.contactPerson.relationship')"
              min-width="80"
            >
              <template slot-scope="scope">
                {{ $t('authModule.contactPerson.relation')[scope.row.relation] }}
              </template>
            </el-table-column>
            <el-table-column
              prop="contactName"
              :label="$t('authModule.contactPerson.name')"
              min-width="100"
            />
            <el-table-column
              prop="contactPhone"
              :label="$t('authModule.contactPerson.phone')"
              min-width="150"
            />
            <el-table-column
              prop="phoneNumStatus"
              :label="$t('authModule.contactPerson.status')"
              min-width="80"
            >
              <template slot-scope="scope">
                {{ scope.row['phoneNumStatus'] !== null ? $t('authModule.contactPerson.state')[scope.row['phoneNumStatus']] : '' }}
              </template>
            </el-table-column>
            <el-table-column
              prop="modifyTime"
              :label="$t('authModule.contactPerson.lastUpdated')"
              min-width="150"
            />
            <el-table-column
              prop="modifyOperatorName"
              :label="$t('authModule.contactPerson.updater')"
              min-width="100"
            />
            <el-table-column
              :label="$t('authModule.contactPerson.operation')"
              min-width="250"
            >
              <template slot-scope="scope">
                <el-button type="text" @click="setContactState(scope.row, 1)">{{ $t('authModule.contactPerson.connectedNot') }}</el-button>
                <el-button type="text" @click="setContactState(scope.row, 2)">{{ $t('authModule.contactPerson.shutdown') }}</el-button>
                <el-button type="text" @click="setContactState(scope.row, 3)">{{ $t('authModule.contactPerson.emptyNumber') }}</el-button>
                <el-button type="text" @click="setContactState(scope.row, 4)">{{ $t('authModule.contactPerson.knowNot') }}</el-button>
                <el-button type="text" @click="setContactState(scope.row, 5)">{{ $t('authModule.contactPerson.available') }}</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--      KTP验证-->
    <el-card v-if="Object.keys(ktpCheckInfoData).length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.ktpVerification.title') }}
          </template>
          <table>
            <tr>
              <td>{{ $t('authModule.ktpVerification.nameHand') }}</td>
              <td>
                <p>{{ ktpCheckInfoData['inputName'] ? toUpper(ktpCheckInfoData['inputName']) : '' }}</p>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 1">
                  {{ ktpCheckInfoData['ktpIdentityName'] }}
                </span>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 1" style="background-color: #19be6b" class="ktpBtn">
                  {{ ktpCheckInfoData['ktpIdentityNamePercent'] }}
                </span>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 3">
                  null
                </span>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 2" style="background-color: #ed4014" class="ktpBtn">
                  {{ ktpCheckInfoData['ktpIdentityMessage'] }}
                </span>
              </td>
              <td>{{ $t('authModule.ktpVerification.identityHand') }}</td>
              <td>
                <p>{{ ktpCheckInfoData['inputIdNumber'] }}</p>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 1">
                  {{ ktpCheckInfoData['ktpIdentityIdNumber'] }}
                </span>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 1" style="background-color: #19be6b" class="ktpBtn">
                  SUCCESS
                </span>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 3">
                  null
                </span>
                <span v-if="ktpCheckInfoData['ktpIdentityCheckRes'] === 2" style="background-color: #ed4014" class="ktpBtn">
                  {{ ktpCheckInfoData['ktpIdentityMessage'] }}
                </span>
              </td>
              <td colspan="2">{{ $t('authModule.ktpVerification.ktp') }}</td>
            </tr>

            <tr>
              <td>{{ $t('authModule.ktpVerification.nameIdentify') }}</td>
              <td>{{ ktpCheckInfoData['name'] }}</td>
              <td>{{ $t('authModule.ktpVerification.nik') }}</td>
              <td>{{ ktpCheckInfoData['idNumber'] }}</td>
              <td colspan="2" rowspan="8">
                <div style="height: 300px">
                  <el-image
                    v-if="ktpCheckInfoData['ktpPath']"
                    style="width: 300px; height: 300px"
                    :src="ktpCheckInfoData['ktpPath']"
                    :preview-src-list="[ktpCheckInfoData['ktpPath']]"
                  />
                </div>
              </td>
            </tr>
            <tr>
              <td>{{ $t('authModule.ktpVerification.gender') }}</td>
              <td>{{ $t('authModule.personalInfo.genderType')[ktpCheckInfoData['gender']] }}</td>
              <td>{{ $t('authModule.ktpVerification.born') }}</td>
              <td>{{ ktpCheckInfoData['birthPlaceBirthday'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.ktpVerification.maritalStatus') }}</td>
              <td>{{ ktpCheckInfoData['maritalStatus'] }}</td>
              <td />
              <td />
            </tr>
            <tr>
              <td>{{ $t('authModule.ktpVerification.address') }}</td>
              <td>{{ ktpCheckInfoData['address'] }}</td>
              <td>{{ $t('authModule.ktpVerification.rtRw') }}</td>
              <td>{{ ktpCheckInfoData['rtrw'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.ktpVerification.rural') }}</td>
              <td>{{ ktpCheckInfoData['village'] }}</td>
              <td>{{ $t('authModule.ktpVerification.area') }}</td>
              <td>{{ ktpCheckInfoData['district'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.ktpVerification.city') }}</td>
              <td>{{ ktpCheckInfoData['city'] }}</td>
              <td>{{ $t('authModule.ktpVerification.province') }}</td>
              <td>{{ ktpCheckInfoData['province'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.ktpVerification.faith') }}</td>
              <td>{{ ktpCheckInfoData['religion'] }}</td>
              <td>{{ $t('authModule.ktpVerification.jobs') }}</td>
              <td>{{ ktpCheckInfoData['occupation'] }}</td>
            </tr>
            <tr>
              <td>{{ $t('authModule.ktpVerification.nationality') }}</td>
              <td>{{ ktpCheckInfoData['nationality'] }}</td>
              <td>{{ $t('authModule.ktpVerification.validUntil') }}</td>
              <td>{{ ktpCheckInfoData['expiryDate'] }}</td>
            </tr>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--      活体校验-->
    <el-card v-if="Object.keys(livingCheckInfoData).length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.liveCalibration.title') }}
            <el-tag v-if="livingCheckInfoData['livenessScore'] !== null">
              {{ livingCheckInfoData['livenessScore'] }}
            </el-tag>
          </template>
          <table>
            <tr>
              <td>{{ $t('authModule.liveCalibration.verification') }}</td>
              <td>{{ $t('authModule.liveCalibration.ktp') }}</td>

            </tr>
            <tr>
              <td>
                <div style="height: 200px">
                  <el-image
                    v-if="livingCheckInfoData['imgUrl']"
                    style="width: 200px; height: 200px"
                    :src="livingCheckInfoData['imgUrl']"
                    :preview-src-list="[livingCheckInfoData['imgUrl']]"
                  />
                </div>
              </td>
              <td>
                <div style="height: 200px">
                  <el-image
                    v-if="livingCheckInfoData['ktpPath']"
                    style="width: 200px; height: 200px"
                    :src="livingCheckInfoData['ktpPath']"
                    :preview-src-list="[livingCheckInfoData['ktpPath']]"
                  />
                </div>
              </td>
            </tr>
            <tr v-if="livingCheckInfoData['livenessScore'] !== null">
              <td>
                {{ $t('authModule.liveCalibration.similarity') }}
              </td>
              <td>
                {{ livingCheckInfoData['livenessScore'] }}
              </td>
            </tr>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
    <!--     历史订单关联设备信息-->
    <el-card v-if="creditDeviceInfoData.length > 0">
      <el-collapse accordion value="1">
        <el-collapse-item name="1">
          <template slot="title">
            {{ $t('authModule.creditDeviceInfo.title') }}
          </template>
          <el-table
            :header-cell-style="{background:'#eef1f6',color:'#606266'}"
            :data="creditDeviceInfoData"
            border
            :stripe="true"
            style="width: 100%"
          >
            <el-table-column
              prop="applyDateStr"
              :label="$t('authModule.creditDeviceInfo.time')"
              min-width="160"
            />
            <el-table-column
              prop="orderNo"
              :label="$t('authModule.creditDeviceInfo.creditOrderNo')"
              min-width="170"
            />
            <el-table-column
              prop="deviceType"
              :label="$t('authModule.creditDeviceInfo.name')"
              min-width="120"
            />
            <el-table-column
              prop="imei"
              :label="$t('authModule.creditDeviceInfo.imei')"
              min-width="120"
            />
            <el-table-column
              prop="androidId"
              :label="$t('authModule.creditDeviceInfo.id')"
              min-width="170"
            />
            <el-table-column
              prop="advertisingId"
              :label="$t('authModule.creditDeviceInfo.google')"
              min-width="320"
            />
            <el-table-column
              prop="ram"
              :label="$t('authModule.creditDeviceInfo.ram')"
              min-width="120"
            />
            <el-table-column
              prop="rom"
              :label="$t('authModule.creditDeviceInfo.rom')"
              min-width="120"
            />
            <el-table-column
              prop="resolution"
              :label="$t('authModule.creditDeviceInfo.resolution')"
              min-width="120"
            />
            <el-table-column
              prop="virtual"
              :label="$t('authModule.creditDeviceInfo.virtualMachine')"
              min-width="120"
            />
          </el-table>
        </el-collapse-item>
      </el-collapse>
    </el-card>
  </el-row>
</template>

<script>
import { deviceInfo, userWorkInfo, ktpCheckInfo, livingCheckInfo, creditDeviceInfo } from '@/api/auth'
export default {
  name: 'ReviewInfo',
  props: {
    orderInfoData: {
      type: Object,
      default: function() {
        return {}
      }
    },
    userInfoData: {
      type: Object,
      default: function() {
        return {}
      }
    },
    userContactData: {
      type: Array,
      default: function() {
        return []
      }
    }
  },
  data() {
    return {
      path: this.$route.path,
      deviceInfoData: {},
      userWorkInfoData: {},
      ktpCheckInfoData: {},
      livingCheckInfoData: {},
      creditDeviceInfoData: [],
      para: {}
    }
  },
  mounted() {
    this.para = this.$route.query
    this.getDeviceInfo()
    this.getUserWorkInfo()
    this.getKtpCheckInfo()
    this.getLivingCheckInfo()
    this.getCreditDeviceInfo()
  },
  methods: {
    getDeviceInfo() {
      deviceInfo(this.para['orderId'])
        .then(res => {
          if (res.success) {
            this.deviceInfoData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.$message.error(err.message)
        })
    },
    getUserWorkInfo() {
      userWorkInfo(this.para['orderId'])
        .then(res => {
          if (res.success) {
            this.userWorkInfoData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.$message.error(err.message)
        })
    },
    getKtpCheckInfo() {
      const data = {
        userId: this.para.userId,
        creditOrderId: this.para.orderId
      }
      ktpCheckInfo(data)
        .then(res => {
          if (res.success) {
            this.ktpCheckInfoData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.$message.error(err.message)
        })
    },
    getLivingCheckInfo() {
      const data = {
        userId: this.para.userId,
        creditOrderId: this.para.orderId
      }
      livingCheckInfo(data)
        .then(res => {
          if (res.success) {
            this.livingCheckInfoData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.$message.error(err.message)
        })
    },
    getCreditDeviceInfo() {
      creditDeviceInfo(this.para.userId)
        .then(res => {
          if (res.success) {
            this.creditDeviceInfoData = res.data
          } else {
            this.$message.error(res.message)
          }
        })
        .catch(err => {
          this.$message.error(err.message)
        })
    },
    setContactState(item, index) {
      this.$emit('set-contact-state', item, index)
    },
    toUpper(data) {
      return data !== null ? data.toUpperCase() : ''
    }
  }
}
</script>

<style lang="scss" scoped>
.el-card{
  margin: 0 0 10px 0;
}
table{
  width: 100%;
  border-collapse: collapse;
  tr{
    width: 100%;
    text-align: center;
    td{
      height: 50px;
      border: 1px #cccccc solid;
    }
  }
}
.ktpBtn{
  padding:0 5px;
  color: #ffffff;
  border-radius: 40px;
}
</style>
